package tom.client.invoice;

import java.util.List;

import tom.shared.ContDept;
import tom.shared.Contact;
import tom.shared.ContactGroup;
import tom.shared.Customer;
import tom.shared.InvItem;
import tom.shared.Invoice;
import tom.shared.Payment;
import tom.shared.Paymeth;
import tom.shared.RReason;
import tom.shared.Supplier;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface ServiceAsync {

	void selectContact(String contCode, AsyncCallback<Contact> callback);

	void insertContact(Contact record, AsyncCallback<Boolean> callback);

	void updateContact(Contact record, AsyncCallback<Boolean> callback);

	void deleteContact(String contCode, AsyncCallback<Boolean> callback);

	void selectContGroup(Integer grpId, AsyncCallback<ContactGroup> callback);

	void insertContGroup(String contCode, Integer grpId,
			AsyncCallback<Boolean> callback);

	void deleteContGroup(String contCode, Integer grpId,
			AsyncCallback<Boolean> callback);

	void selectContGroup(String contCode,
			AsyncCallback<List<ContactGroup>> callback);

	void insertContGroup(ContactGroup record, AsyncCallback<Boolean> callback);

	void deleteContGroup(Integer grpId, AsyncCallback<Boolean> callback);

	void updateContGroup(ContactGroup record, AsyncCallback<Boolean> callback);

	void selectCustomer(String contCode, AsyncCallback<Customer> callback);

	void insertDebter(Customer record, AsyncCallback<Boolean> callback);

	void updateCustomer(Customer record, AsyncCallback<Boolean> callback);

	void deleteDebter(String contCode, AsyncCallback<Boolean> callback);

	void insertInvoice(Invoice inv, AsyncCallback<String> callback);

	void searchInvoice(String docRef, String invDate, String docuKind,
			String systemKind, String totalAmt, Boolean balanceDue, String address, String contCode,
			String status, AsyncCallback<List<Invoice>> callback);

	void selectInvoice(Integer invNo, AsyncCallback<Invoice> callback);

	void selectInvItem(Integer invNo, AsyncCallback<List<InvItem>> callback);

	void deleteInvoice(Integer invNo, AsyncCallback<Boolean> callback);

	void updateInvoice(Invoice inv, AsyncCallback<String> callback);

	void selectPayment(String payNo, AsyncCallback<Payment> callback);

	void insertPayment(Payment record, AsyncCallback<Boolean> callback);

	void updatePayment(Payment record, AsyncCallback<Boolean> callback);

	void deletePayment(String payNo, AsyncCallback<Boolean> callback);

	void selectPayment(Integer invNo, AsyncCallback<List<Payment>> callback);

	void selectPaymeth(AsyncCallback<List<String[]>> callback);

	void selectContDept(String contCode, AsyncCallback<List<ContDept>> callback);

	void insertContDept(ContDept record, AsyncCallback<Boolean> callback);

	void deleteContDept(String contCode, AsyncCallback<Boolean> callback);

	void updateContDept(ContDept record, AsyncCallback<Boolean> callback);

	void deletePaymeth(Paymeth contCode, AsyncCallback<Boolean> callback);

	void insertPaymeth(Paymeth record, AsyncCallback<Boolean> callback);

	void selectPaymeth(String payCode, AsyncCallback<List<Paymeth>> callback);

	void updatePaymeth(Paymeth record, AsyncCallback<Boolean> callback);

	void refundInvoice(Invoice record, AsyncCallback<String> callback);

	void isStockUpdate(String resCode, AsyncCallback<RReason> callback);

	void selectAddrDept(String contCode, AsyncCallback<List<ContDept>> callback);

	void saveAddrDept(List<ContDept> list, AsyncCallback<Boolean> callback);

	void updateSupplier(Supplier record, AsyncCallback<Boolean> callback);

	void selectSupplier(String contCode, AsyncCallback<Supplier> callback);

	void insertPayment(Invoice inv, AsyncCallback<Boolean> callback);

	void rollbackInvoice(Integer invNo, AsyncCallback<Boolean> callback);

	void find(String docuKind, String docRef, AsyncCallback<Integer> callback);

}
